<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich">
	
	<h:panelGrid columns="2">
		<s:graphicImage value="#{post.imagem}">
    		<s:transformImageSize maintainRatio="true" width="100" />
    	</s:graphicImage>
		<h:panelGrid>
			<s:decorate>
				<s:link view="/Ler.xhtml" action="#{leituraCtrl.ler}">
					<h:outputText value="#{post.titulo}" />
					<f:param name="postId" value="#{post.id}" />
				</s:link>
			</s:decorate>
			<s:decorate>
				<h:outputText value="#{post.usuario.nome}" />
				<h:outputText value=" #{messages.em} " />
				<h:outputText value="#{post.data}">
					<s:convertDateTime pattern="dd/MM/yyyy HH:mm" />
				</h:outputText>
			</s:decorate>
			<s:decorate rendered="#{not empty post.mediaAvaliacoes}">
				<h:outputText value="#{messages.media} " />
				<h:outputText value="#{post.mediaAvaliacoes}">
					<f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
				</h:outputText>
			</s:decorate>
			<s:decorate>
				<h:outputText value="Favorito de #{post.quantidadeFavoritos}" rendered="#{not empty post.quantidadeFavoritos}" />
			</s:decorate>
		</h:panelGrid>
	</h:panelGrid>
	
</ui:composition>